1. Introduction


This project consists of 1 Mobile App, 1 Admin Portal clubbed Website.

Technologies Used in Web App are:

  1. React.Js
  2. Redux
  3. Material UI
  4. Firebase Realtime Database

We have built the Mobile App using React Native(Expo) for iOS and Android

The main Technologies used are

  1. React Native
  2. Expo
  3. React Native Elements

2. Help And Support


Follow the link for more info on support.

HELP & SUPPORT

3. Environment Setup


To run the 2 Apps you need following things in your development machine as mentioned below.


A. Download NodeJs

HTML Structure
    • Download instructions
    • Mac users: For OS X, download the .pkg file form below link.(v.18.18.2 recommended)
    • Windows users: Download either the MSI or the .exe form below link, whichever you prefer .(v.18.18.2 recommended)
    Download Node v.18.18.2 from here
  1. After Installing NodeJs you'll most likely need to restart your computer.
  2. To ensure that NodeJs is installed correctly, you can type:

    node -v

    NOTE: DO NOT IGNORE THE NODE JS VERSION. IT HAS TO BE 18.18.x

B. Install Git (Windows PC Only)

C. Install Python 3.12.0 (M1 Mac Only)

D. Install Eas Cli

HTML Structure

In your command prompt, type:

npm install -g eas-cli

Create a account in https://expo.io/signup and use the same account to signin on command prompt using below command

eas login

E. Install Yarn

In your command prompt, type:

npm install -g yarn

F. Install Firebase Tools and Login to Firebase

In your command prompt, type:

npm install -g firebase-tools

You have to login in firebase from the command prompt using below command

firebase login

G. Copy Firebase Login Token

An access token from firebase is also required by the Eas build service. Again signin in firebase using below command

firebase login:ci

Step 1 Select Google account

HTML Structure

Step 2 Allow the firebase

HTML Structure

You got success message

HTML Structure

Go to command prompt and copy the token

HTML Structure

Now go to your Expo account -> Select the project -> Create a Secret

HTML Structure HTML Structure

Use Secret name FIREBASE_TOKEN and in Secret value paste the token and Save.

HTML Structure

4. Project Configuration


Step 1 First Extract the Zip file downloaded from codecanyon.

Open the folder 'Sourecode' in Code Editor after extracting the Zip


Step 2 Change the App Name and App Description in the /functions/config.json

The app_identifier is very important. It is also known as Package Name in Android World and Bundle Identifier in iOS World

It is written like com.your-organisation-website-name.app-name

e.g. Exicube has developed a Taxi App. Then the identifier can be com.exicube.taxi

Note: The app_identifier should be in lowercase only.

HTML Structure

Step 3 Change all Logo, Splash and other images related to branding kept in assets folders

  • mobile-app/assets/images/logo1024x1024.png
  • mobile-app/assets/images/splash.png
  • mobile-app/assets/images/logo96x96.png
  • mobile-app/assets/images/logo165x90white.png
  • mobile-app/assets/images/intro.jpg
  • mobile-app/assets/images/bg.jpg
  • web-app/public/favicon.ico
  • web-app/public/apple-icon.png
  • web-app/src/assets/img/logo138x75black.png
  • web-app/src/assets/img/logo138x75white.png
  • web-app/src/assets/img/logo192x192.png

Note: Do not change any dimension or file name of the images given. Only overwrite the content of image using image editor.

Step 4 Go to Firebase Console and then create a new project as shown in picture.


HTML Structure

Type in your project name as shown in picture.


HTML Structure

Accept terms and click on 'Create Project' as shown in picture.


HTML Structure

When your project is ready click the 'Continue' button as shown in picture.

HTML Structure

Create a new Realtime Database as shown in picture.

NOTE: Update billing Spark to Blaze

HTML Structure

Start in locked mode and then enable it.

HTML Structure

Create a new Storage as shown in picture.

HTML Structure

Start in Production mode and then next it.

HTML Structure

Step 5 Configure GCP Server Location.

1. Select Default GCP resource location in Firebase Portal -> Settings -> General

GCPServerConfig

2. Copy Project ID from Firebase Portal -> Settings -> General and paste in the /functions/config.json as shown below. Change the XXXXXX only. Do not tamper with the JSON structure.

HTML Structure

Step 6 Change the Google map keys in the same file /functions/config.json.

Replace XXXXXX only. You can use same API key in 4 places or 4 different API keys for the 4 different platforms to better monitor platform wise usage and advance security.

HTML Structure

Follow the Steps below to collect a valid Google API Key

Open https://console.cloud.google.com/google/maps-apis/overview

Google API Key 1

Create a new project. Make sure the type of project is MAP PLATFORM type if asked and Billing will be dollar $ USD based. You will have to setup a Billing account if you do not have a dollar $ billing account. Then click on Create. Note: Firebase creates a project in Google cloud also. Avoid using the same for the Google Maps project.

Google API Key 2

Click on Menu Icon -> API & Services -> Credentials

Google API Key 3

Click on "Create Credential"

Google API Key 4

Click on "Create Credential" Copy the API key. This will be used in code.

Google API Key 5

Couple of more steps required from some extra permissions. Click on API & Services -> Dashboard -> Enable APIs and Services

Google API Key 6

Enable All the APIs show below. Very Important

  1. Distance Matrix API
  2. Geocoding API
  3. Directions API
  4. Places API
  5. Maps JavaScript API
  6. Maps SDK for IOS
  7. Maps SDK for Android

Google API Key 7

This is how you enable each API. Enable all the 7

Google API Key 8

Note: Enable billing in this Google Cloud Platform. Very important.

Google API Key 9

Step 7 You should enter the Purchase Code in the /functions/config.json.

HTML Structure


Step 8 Go to firebase console and Click on Authetication Menu. Click on Sign-in-Method. Click on Google icon then enter your email id now click on Save button and follow the instruction as show in pictures

GOOGLE

GOOGLE

GOOGLE

Step 9 Click on Authetication Menu and click on Sign-in Method and hover on Email/ Password pencil icon and follow the instruction as show in pictures


HTML Structure

HTML Structure

HTML Structure

HTML Structure

Similarly enable the Phone Auth as shown below

Enable Mobile

Similarly enable the Apple Auth as shown below. Also add the Bundle Indentifier in the "Service ID"

Enable Apple


Step 10 Create a project in https://expo.dev by logging with your Expo account

Try to use the same Firebase Project Id in Slug

HTML Structure

Click to open the project

HTML Structure

Copy the Owner, Slug and ID in the expo_owner, expo_slug and expo_project_id of config.json respectively

HTML Structure

Step 11 In admin_email field use Admin email id which will create admin account with this email id
Note: This will be the same email you will use to login as Admin user.

5. Deploying the Web App plus Server Side


Run the below commands to run and deploy the web app.

Use Command Prompt in Administrator Mode if using MS Windows. Also note that when you make some changes in code, you have to repeat all these commands.

cd Sourecode yarn yarn deploy

After successfully deploying your project you will receive the hosted url in the terminal.

HTML Structure

Open the URL mentioned in result of the last line of the command. Go to login and type the admin email you mentioned as admin_email on the config.json.

Forgot Password

Use FORGOT PASSWORD to generate new password for Admin.


5.1 Add Payment Gateway


For activating any Payment Gateway, add the API keys of the payment gateway you want in the Payment Settings of Admin panel and make the active as true then click on Submit button.

HTML Structure

6. Build Native Mobile App


Go into the Main code folder in Command Prompt

cd Sourecode
  1. For building Android
  2. yarn app:build-android
  3. For building IOS
  4. yarn app:build-ios

*For APK build run yarn app:build-android-apk

When anything asked in the process above, let eas build handle all the certificate and key generation for you.



7. Post Build Setup


7.1 Setting Push Notification for Android


For Android Push Notifications

    Goto your Google cloud console and enable Firebase Cloud Messaging API

    HTML Structure

    Go to Firebase Portal -> Project Settings -> Service accounts -> click the button to Generate new private key for the Firebase Admin SDK and download the JSON

    HTML Structure

    Then Go your Expo account -> Select Project -> Project settings -> Credentials -> choose Android -> Application Identifier


    HTML Structure

    Click the Add a service account key

    HTML Structure

    Then Go Upload new key tab and select the JSON that you got from Firebase -> Service accounts section


    HTML Structure

    HTML Structure




7.2 Copy Android SHA-1 To Firebase



    Go to Expo Account -> Select The Project -> Credentials

    HTML Structure
    HTML Structure


    Click on Application Identifiers

    HTML Structure


    Copy the SHA-1 Certificate Fingerprint

    HTML Structure


    Go to your Firebase Portal -> Project Settings -> General -> Android apps -> Click on Add Fingerprint

    HTML Structure


    Now paste the SHA-1 Certificate Fingerprint and Click on Save button

    HTML Structure

    After Publish Your App in PlayStore Copy SHA-1 certificate fingerprint

    HTML Structure

    And Paste It in your Firebase Portal -> Project Settings -> General -> Android apps -> Click on Add Fingerprint

    HTML Structure



7.3 Upload Apple APNs to Firebase



    Go to Expo Account -> Select The Project -> Credentials

    HTML Structure
    HTML Structure


    Click on Application Identifiers(IOS)

    HTML Structure


    Go to Service Credentials > Push Key > Press Push Key Button and copy Key ID and Apple Team Identifier


    HTML Structure


    Go to Firebase Portal -> Project Settings -> Cloud Messaging -> Apple app configuration -> Upload the downloaded Push Key in APNs Authentication Key


    HTML Structure


    Browse the downloaded Push Key file and paste both Key ID and Apple Team Identifier Respectively


    HTML Structure

    HTML Structure

8. Additional Settings For Google Login


How To Set Google Login In Your Project

Go your google cloud console > APIs & Services > Credentials

HTML Structure

Then click on Web client (auto created by Google Service)

HTML Structure

Authorized JavaScript origins > add your web url(Firebase Portal -> Hosting -> Domains) and click on Save button

HTML Structure

HTML Structure

HTML Structure

Then go your OAuth consent screen > then select External > click on create button

HTML Structure

Then go Authorized domains section and add your web url(Firebase Portal -> Hosting -> Domains) and add your email id .
Then click on SAVE AND CONTINUE button

HTML Structure

gototop

© 2024 Exicube App Solutions (OPC) Private Limited.  | Developed by Exicube